package tr.com.netgis;

import tr.com.netgis.db.NGDbHelper;
import android.app.Activity;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.widget.BaseAdapter;

public class NGListActivity extends Activity {

	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		inititializeDB();
	}	
	
	protected void inititializeDB (){
		mHelper = new NGDbHelper(this);	
		mDb = mHelper.getWritableDatabase();
	}

	@Override
	protected void onDestroy() {
		if (mCursor != null)
			mCursor.close();
		if (mDb != null)
			mDb.close();	
		mHelper.close();
		super.onDestroy();
	}
	
	@Override
	protected void onRestart() {
		super.onRestart();
		if (!mDb.isOpen())
			inititializeDB();
	}




	protected NGDbHelper mHelper;
	protected SQLiteDatabase mDb;
	protected Cursor mCursor;
	protected BaseAdapter mAdapter;	
	
}
